package org.osll.tictactoe.engine;

import java.io.Serializable;
import java.util.Date;

import org.osll.tictactoe.CurrentMove;
import org.osll.tictactoe.Team;

public class CurrentMoveImpl implements CurrentMove, Serializable {

	public Date getOverTime() {
		return overTime;
	}

	public void setOverTime(Date overTime) {
		this.overTime = overTime;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -6584703988221568500L;

	private Team team = Team.U;
	
	private Date overTime = new Date(0);
	
	public CurrentMoveImpl(Team team, Date countDown) {
		this.team = team;
		this.overTime= countDown;
	}
	
	public CurrentMoveImpl() {
	}

	@Override
	public Team getTeam() {
		return team;
	}

	@Override
	public long getTimeToOver() {
		Date now = new Date();
		return overTime.getTime() - now.getTime();
	}
}
